<?php
class Home extends Controller
{
    public function actionIndex()
    {
        self::$crossParams['title'] = 'Click Mobile';

        $defaultStyle = $this->_loader->config('default_style');

        $this->loadChildControllers(array(
            // header
            'short_detail_cart' => 'cart/short-detail',

            // left siderbar
            'quick_search' => 'module/QuickSearch',
            'category'      => 'module/Category',
            'contact_info'  => 'module/ContactInfo',
            'support'       => 'module/Support',

            // right sidebar
            'featured_product' => 'module/FeaturedProduct',
            'discounting_product' => 'module/DiscountingProduct',
        ));

        // Layout params
        $styles = array(
            "styles/$defaultStyle/css/nivo-slider.css",
            'js/default/jquery/nivo-slider/themes/click/click.css',
        );

        $scripts = array(
            'js/default/jquery/nivo-slider/jquery.nivo.slider.pack.js',
            "styles/$defaultStyle/js/home.js"
        );

        $layoutParams = array(
            'styles' => $styles,
            'scripts' => $scripts
        );

        $viewParams = array(
            // controllers
            'slideshow'         => $this->fetchChildController('module/slideshow'),
            'newest_product_mobile' => $this->fetchChildController('product/newestmobile'),
            'newest_product_device' => $this->fetchChildController('product/newestdevice'),
            'best_sold_product_mobile' => $this->fetchChildController('product/bestsoldmobile'),
            'best_sold_product_device' => $this->fetchChildController('product/bestsolddevice'),



            'product' => array()
        );

        return $this->responseView('home', $viewParams, 'layout/fullwidth', $layoutParams);
    }
}
